import time

from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
sideName = '网站很好看'
testCase = "DBshop015"
firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','管理分类','前台侧边设置')

firefox.find_element_by_xpath('//a[contains(.,"添加侧边显示")]').click()
firefox.find_element_by_id('frontside_name').send_keys(sideName)
firefox.find_element_by_xpath('//button[contains(.,"保存侧边显示信息")]').click()
time.sleep(3)

firefox.get(url)

try:
    firefox.find_element_by_link_text(sideName)
    writeLog("%s 测试通过"%testCase)
except:
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
firefox.quit()
